# set file names
PIDFILE="$ddns_rundir/$SECTION_ID.pid" # Process ID file
UPDFILE="$ddns_rundir/$SECTION_ID.update" # last update successful send (system uptime)
+CHKFILE="$ddns_rundir/$SECTION_ID.nextcheck" # next check (system uptime + check interval)
DATFILE="$ddns_rundir/$SECTION_ID.dat" # save stdout data of WGet and other extern programs called
ERRFILE="$ddns_rundir/$SECTION_ID.err" # save stderr output of WGet and other extern programs called
IPFILE="$ddns_rundir/$SECTION_ID.ip" #
# now we wait for check interval before testing if update was recognized
[ $DRY_RUN -eq 0 ] && {
- write_log 7 "Waiting $CHECK_SECONDS seconds (Check Interval)"
+ get_uptime NOW_TIME
+ echo $(($NOW_TIME + $CHECK_SECONDS)) > $CHKFILE # save the next scheduled check time
+ NEXT_CHECK_TIME=$( date -d @$(( $(date +%s) + $CHECK_SECONDS )) +"$ddns_dateformat" )
+ write_log 7 "Waiting $CHECK_SECONDS seconds (Check Interval); Next check at $NEXT_CHECK_TIME"
sleep $CHECK_SECONDS &
PID_SLEEP=$!
wait $PID_SLEEP # enable trap-handler